feat: add non-interactive flags for setup-aws/gcp and env load#92
Open
crowlbot wants to merge 1 commit into
Open
feat: add non-interactive flags for setup-aws/gcp and env load#92crowlbot wants to merge 1 commit into
crowlbot wants to merge 1 commit into
Conversation
689c195 to
e520178
Compare
Second slice of the agent-ergonomics series. The previous PR added the
global `--non-interactive` flag and the `requireInteractive()` guard;
this one wires up the per-command flags so agents can actually drive
the wizard subcommands end-to-end.
- `setup-aws`:
- `--policies <arn>` (repeatable) replaces the interactive policy
multi-select. With `--non-interactive` set and no `--policies`,
we now fail fast with `MISSING_FLAG` instead of blocking on stdin.
- `--role-name <name>` replaces the random-suffixed default, so
re-running the wizard with the same name is idempotent (subject to
the underlying AWS error if the role already exists).
- The final "apply these changes?" `confirm()` now auto-accepts in
non-interactive mode.
- `setup-gcp`:
- `--roles <role>` (repeatable) — same treatment as `--policies`.
- `--service-account-name <name>` — same treatment as `--role-name`.
- `--enable-apis` skips the "enable missing APIs?" confirmation; the
final apply-confirmation also auto-accepts in non-interactive mode.
- `env load`: the existing TTY-only guard now also fires when
`--non-interactive` is set on a TTY, so `env load .env --non-interactive`
no longer falls through to a blocking `prompt()`.
Existing interactive UX is unchanged when stdout is a TTY and no
`--non-interactive` flag is set. The `getOrg`/`getApp` selection paths
already route through `requireInteractive()`, which the previous PR
taught to honor `context.nonInteractive`, so no additional changes
were needed there.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cfd9e77 to
535af87
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #91. Wires up per-command non-interactive flags so the wizard subcommands (
setup-aws,setup-gcp) andenv loadcan be driven end-to-end by an agent.What's in this PR
setup-aws--policies <arn>(repeatable) replaces the interactive policy multi-select. In--non-interactivemode without--policies, fails fast withMISSING_FLAGinstead of blocking on stdin.--role-name <name>replaces the random-suffixed default, enabling idempotent re-runs (subject to the underlying AWS error if the role already exists).--non-interactive.setup-gcp--roles <role>(repeatable) — same treatment as--policies.--service-account-name <name>— same treatment as--role-name.--enable-apisskips the "enable missing APIs?" confirmation; the final apply-confirmation also auto-accepts in non-interactive mode.env load--non-interactiveis set on a TTY, soenv load .env --non-interactiveno longer falls through to a blocking `prompt()`. Error message points at--replaceor--skip-existing.The
getOrg/getAppselection paths already route throughrequireInteractive(), which PR #91 taught to honorcontext.nonInteractive, so no additional changes were needed there.Test plan
deno fmtcleandeno lintcleandeno check main.ts— same error count asmain(114; pre-existing TS/Cliffy issues). No new regressions.deno test -A tests/agent.test.ts— 6/6 pass (new test covers thesetup-aws --non-interactiveerror envelope).deno test -A tests/create.test.ts— 17/17 pass (no regression).--non-interactiveis set.Notes on idempotency
--role-name/--service-account-namelet re-runs reuse a known name, but the underlying AWS/gcloud CLI will still error if the resource exists. That's by design for this PR (avoid clobbering existing user resources). A later idempotency PR can layer "already exists is OK" semantics on top via a--reuse-if-existsflag.🤖 Generated with Claude Code